package com.ccrfid.rmc6.service.sys;

import com.ccrfid.rmc6.appconfig.exception.pojo.AppException;
import com.ccrfid.rmc6.entity.sys.AppModuleEntity;
import com.ccrfid.rmc6.entity.sys.RoleEntity;
import com.ccrfid.rmc6.pojo.dto.sys.AppModuleDto;
import com.ccrfid.rmc6.repository.search.SearchCriteria;
import com.ccrfid.rmc6.resource.auth.pojo.UserPrincipal;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

public interface RoleService {
    //
    Page<RoleEntity> getRolePage(SearchCriteria criteria, Pageable pageable);
    //
    List<RoleEntity> getRoleList();
    //
    RoleEntity getRole(Long roleId);
    //
    RoleEntity createRole(RoleEntity entity) throws AppException;
    //
    RoleEntity updateRole(Long roleId, RoleEntity entity) throws AppException;
    //
    int deleteRoles(List<Long> idList);
    //
    List<AppModuleEntity> getAppModules(Long roleId, UserPrincipal userPrincipal) throws AppException;

    List<AppModuleDto> getAppModules2(Long roleId, UserPrincipal userPrincipal) throws AppException;
    //
    void updateRoleModuleList(Long roleId, UserPrincipal userPrincipal, List<Long> moduleIdList) throws AppException;
}
